abstraction
Class AvailableServices

java.lang.Object
  extended by abstraction.AvailableServices
All Implemented Interfaces:
java.lang.Cloneable

public class AvailableServices
extends java.lang.Object
implements java.lang.Cloneable

This Class manages a community, an ArrayList of Avalialble Service


Field Summary
private  java.util.ArrayList<Service> availableService
           
 
Constructor Summary
AvailableServices()
           
 
Method Summary
 boolean addService(Service toAdd)
          Method to add a service in Community
 java.lang.Object clone()
           
 boolean containService(Service service)
          This method checks if community contains a service
 boolean deleteAllCommunity(AvailableServices community)
          Method to delete all Community
 void deleteService(int index)
          Method to delete a service from Community
 Service get(int index)
          Returns the element at the specified position in this list.
 java.util.Iterator<Service> getIterator()
          Method gets enumerator on key of hashtable Community
 int getPosition(Service toFind)
          Method gets position of service
 int sizeCommunity()
          This method says how many services there are inside a community
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

availableService

private java.util.ArrayList<Service> availableService
Constructor Detail

AvailableServices

public AvailableServices()
Method Detail

addService

public boolean addService(Service toAdd)
Method to add a service in Community

Parameters:
toAdd - service to add
Returns:
boolean. True if the service is added with successful, false otherwise

deleteService

public void deleteService(int index)
Method to delete a service from Community

Parameters:
index - of the service to delete

deleteAllCommunity

public boolean deleteAllCommunity(AvailableServices community)
Method to delete all Community

Parameters:
community - to delete
Returns:
boolean. True community is deleted with successful, false otherwise

sizeCommunity

public int sizeCommunity()
This method says how many services there are inside a community

Returns:
int with community's size

containService

public boolean containService(Service service)
This method checks if community contains a service

Parameters:
service - to check if it is into community
Returns:
boolean. True community is deleted with successful, false otherwise

get

public Service get(int index)
Returns the element at the specified position in this list.

Parameters:
index - index of the element to return
Returns:
the element at the specified position in this list
Throws:
java.lang.IndexOutOfBoundsException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

getIterator

public java.util.Iterator<Service> getIterator()
Method gets enumerator on key of hashtable Community

Returns:
a type Enumeration

getPosition

public int getPosition(Service toFind)
Method gets position of service

Returns:
int, service's position